<?php
/**
 * Created by hisune.
 * User: Hisune <hi@hisune.com>
 * Date: 2017/3/30
 * Time: 11:33
 *
 * data from http://echarts.baidu.com/asset/map/js/world.js
 * 注：echart默认是用不规范的英文国家名做映射关系，这里转为标准的ISO3166-1国家短码
 */

namespace Hisune\EchartsPHP;

class Countries
{

    static function nameMap()
    {
        return [
            'United States of America' => 'US',
            'The Bahamas' => 'BS',
            'Ivory Coast' => 'CI',
            'Democratic Republic of the Congo' => 'CD',
            'Republic of the Congo' => 'CG',
            'Northern Cyprus' => 'CY',
            'Federated States of Micronesia' => 'FM',
            'Guinea Bissau' => 'GW',
            'Somaliland' => 'SO',
            'Republic of Serbia' => 'RS',
            'Sao Tome and Principe' => 'ST',
            'East Timor' => 'TL',
            'Afghanistan' => 'AF',
            'Angola' => 'AO',
            'Albania' => 'AL',
            'Finland' => 'FI',
            'Andorra' => 'AD',
            'United Arab Emirates' => 'AE',
            'Argentina' => 'AR',
            'Armenia' => 'AM',
            'France' => 'FR',
            'Antigua and Barbuda' => 'AG',
            'Australia' => 'AU',
            'Austria' => 'AT',
            'Azerbaijan' => 'AZ',
            'Burundi' => 'BI',
            'Belgium' => 'BE',
            'Benin' => 'BJ',
            'Burkina Faso' => 'BF',
            'Bangladesh' => 'BD',
            'Bulgaria' => 'BG',
            'Bahrain' => 'BH',
            'Bosnia and Herzegovina' => 'BA',
            'Belarus' => 'BY',
            'Belize' => 'BZ',
            'United Kingdom' => 'GB',
            'Bolivia' => 'BO',
            'Brazil' => 'BR',
            'Barbados' => 'BB',
            'Brunei' => 'BN',
            'Bhutan' => 'BT',
            'Botswana' => 'BW',
            'Central African Republic' => 'CF',
            'Canada' => 'CA',
            'Switzerland' => 'CH',
            'Chile' => 'CL',
            'China' => 'CN',
            'Cameroon' => 'CM',
            'Colombia' => 'CO',
            'Comoros' => 'KM',
            'Cape Verde' => 'CV',
            'Costa Rica' => 'CR',
            'Cuba' => 'CU',
            'Netherlands' => 'NL',
            'Cyprus' => 'CY',
            'Czech Republic' => 'CZ',
            'Germany' => 'DE',
            'Djibouti' => 'DJ',
            'Dominica' => 'DM',
            'Denmark' => 'DK',
            'Dominican Republic' => 'DO',
            'Algeria' => 'DZ',
            'Ecuador' => 'EC',
            'Egypt' => 'EG',
            'Eritrea' => 'ER',
            'Spain' => 'ES',
            'Estonia' => 'EE',
            'Ethiopia' => 'ET',
            'Fiji' => 'FJ',
            'Gabon' => 'GA',
            'Georgia' => 'GE',
            'Ghana' => 'GH',
            'Guinea' => 'GN',
            'Gambia' => 'GM',
            'Equatorial Guinea' => 'GQ',
            'Greece' => 'GR',
            'Grenada' => 'GD',
            'Guatemala' => 'GT',
            'Guyana' => 'GY',
            'Honduras' => 'HN',
            'Croatia' => 'HR',
            'Haiti' => 'HT',
            'Hungary' => 'HU',
            'Indonesia' => 'ID',
            'India' => 'IN',
            'Ireland' => 'IE',
            'Iran' => 'IR',
            'Iraq' => 'IQ',
            'Iceland' => 'IS',
            'Israel' => 'IL',
            'Italy' => 'IT',
            'Jamaica' => 'JM',
            'Jordan' => 'JO',
            'Japan' => 'JP',
            'Kazakhstan' => 'KZ',
            'Kenya' => 'KE',
            'Kyrgyzstan' => 'KG',
            'Cambodia' => 'KH',
            'Kiribati' => 'KI',
            'South Korea' => 'KR',
            'Kosovo' => 'XK',
            'Kuwait' => 'KW',
            'Laos' => 'LA',
            'Lebanon' => 'LB',
            'Liberia' => 'LR',
            'Libya' => 'LY',
            'Saint Lucia' => 'LC',
            'Sri Lanka' => 'LK',
            'Lesotho' => 'LS',
            'Lithuania' => 'LT',
            'Luxembourg' => 'LU',
            'Latvia' => 'LV',
            'Morocco' => 'MA',
            'Moldova' => 'MD',
            'Madagascar' => 'MG',
            'Mexico' => 'MX',
            'Macedonia' => 'MK',
            'Mali' => 'ML',
            'Malta' => 'MT',
            'Myanmar' => 'MM',
            'Montenegro' => 'ME',
            'Mongolia' => 'MN',
            'Mozambique' => 'MZ',
            'Mauritania' => 'MR',
            'Mauritius' => 'MU',
            'Malawi' => 'MW',
            'Malaysia' => 'MY',
            'Namibia' => 'NA',
            'Niger' => 'NE',
            'Nigeria' => 'NG',
            'Nicaragua' => 'NI',
            'New Zealand' => 'NZ',
            'Norway' => 'NO',
            'Nepal' => 'NP',
            'Oman' => 'OM',
            'Pakistan' => 'PK',
            'Panama' => 'PA',
            'Peru' => 'PE',
            'Philippines' => 'PH',
            'Palau' => 'PW',
            'Papua New Guinea' => 'PG',
            'Poland' => 'PL',
            'North Korea' => 'KP',
            'Portugal' => 'PT',
            'Paraguay' => 'PY',
            'Qatar' => 'QA',
            'Romania' => 'RO',
            'Russia' => 'RU',
            'Rwanda' => 'RW',
            'Western Sahara' => 'EH',
            'Saudi Arabia' => 'SA',
            'Sudan' => 'SD',
            'South Sudan' => 'SS',
            'Senegal' => 'SN',
            'Singapore' => 'SG',
            'Solomon Islands' => 'SB',
            'Sierra Leone' => 'SL',
            'El Salvador' => 'SV',
            'Somalia' => 'SO',
            'Suriname' => 'SR',
            'Slovakia' => 'SK',
            'Slovenia' => 'SI',
            'Sweden' => 'SE',
            'Swaziland' => 'SZ',
            'Seychelles' => 'SC',
            'Syria' => 'SY',
            'Chad' => 'TD',
            'Togo' => 'TG',
            'Thailand' => 'TH',
            'Tajikistan' => 'TJ',
            'Turkmenistan' => 'TM',
            'Tonga' => 'TO',
            'Trinidad and Tobago' => 'TT',
            'Tunisia' => 'TN',
            'Turkey' => 'TR',
            'Uganda' => 'UG',
            'Ukraine' => 'UA',
            'Uruguay' => 'UY',
            'Uzbekistan' => 'UZ',
            'Saint Vincent and the Grenadines' => 'VC',
            'Venezuela' => 'VE',
            'Vietnam' => 'VN',
            'Vanuatu' => 'VU',
            'Samoa' => 'WS',
            'Yemen' => 'YE',
            'South Africa' => 'ZA',
            'Zambia' => 'ZM',
            'Zimbabwe' => 'ZW',
        ];
    }

    static function geoMap()
    {
        return array_flip(static::nameMap());
    }

}

